package com.smart.gui;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;

public class TOC_Form_Describe_Existing_Test_Environment extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7937284471985282269L;

	private JPanel contentPane;

	/**
	 * singleton pattern -- getInstance
	 */
	private static TOC_Form_Describe_Existing_Test_Environment uniqueInstanceForm;

	public static synchronized TOC_Form_Describe_Existing_Test_Environment getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new TOC_Form_Describe_Existing_Test_Environment();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public TOC_Form_Describe_Existing_Test_Environment() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Table of Contents of Describe Existing Test Environment Questionnaires");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(100, 100, 535, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane
				.setLayout(new FormLayout(new ColumnSpec[] {
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						FormFactory.DEFAULT_COLSPEC,
						FormFactory.RELATED_GAP_COLSPEC,
						ColumnSpec.decode("default:grow"), }, new RowSpec[] {
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC, }));

		JLabel label = new JLabel("1)");
		contentPane.add(label, "2, 4");

		JButton btnF = new JButton("Functionality");
		btnF.setActionCommand(ButtonHandler.F);
		btnF.addActionListener(handler);
		contentPane.add(btnF, "4, 4");

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "2, 6");

		JButton btnH = new JButton("History");
		btnH.setActionCommand(ButtonHandler.H);
		btnH.addActionListener(handler);
		contentPane.add(btnH, "4, 6");

		JLabel label_2 = new JLabel("3)");
		contentPane.add(label_2, "2, 8");

		JButton btnP = new JButton("Platform");
		btnP.setActionCommand(ButtonHandler.P);
		btnP.addActionListener(handler);
		contentPane.add(btnP, "4, 8");

		JLabel label_3 = new JLabel("4)");
		contentPane.add(label_3, "2, 10");

		JButton btnTD = new JButton("Test Documentation");
		btnTD.setActionCommand(ButtonHandler.TD);
		btnTD.addActionListener(handler);
		contentPane.add(btnTD, "4, 10");

		JLabel label_4 = new JLabel("5)");
		contentPane.add(label_4, "2, 12");

		JButton btnDE = new JButton("Development Environment");
		btnDE.setActionCommand(ButtonHandler.DE);
		btnDE.addActionListener(handler);
		contentPane.add(btnDE, "4, 12");

		JLabel label_5 = new JLabel("6)");
		contentPane.add(label_5, "2, 14");

		JButton btnA = new JButton("Architecture");
		btnA.setActionCommand(ButtonHandler.A);
		btnA.addActionListener(handler);
		contentPane.add(btnA, "4, 14");

		JLabel label_6 = new JLabel("7)");
		contentPane.add(label_6, "2, 16");

		JButton btnC = new JButton("Code");
		btnC.setActionCommand(ButtonHandler.C);
		btnC.addActionListener(handler);
		contentPane.add(btnC, "4, 16");
	}

}
